﻿using System;
using System.Linq;
using System.IO;
using System.IO.IsolatedStorage;
using System.Collections.Generic;
using Microsoft.LightSwitch;
using Microsoft.LightSwitch.Framework.Client;
using Microsoft.LightSwitch.Presentation;
using Microsoft.LightSwitch.Presentation.Extensions;

namespace LightSwitchApplication
{
    public partial class OTCDrugSales
    {
        partial void OTCDrugSales_InitializeDataWorkspace(List<IDataService> saveChangesTo)
        {
            // Write your code here.
            this.SellOrderHeaderProperty = new SellOrderHeader();
        }

        partial void OTCDrugSales_Saved()
        {
            // Write your code here.
            this.Close(false);
            //Application.Current.ShowDefaultScreen(this.SellOrderHeaderProperty);
        }

        partial void PlaceOrder_CanExecute(ref bool result)
        {
            // Write your code here.
            result = this.CanSave && this.SellOrders.Any();
        }

        partial void PlaceOrder_Execute()
        {
            // Write your code here.
            this.Save();
        }
    }
}